package model.events;

import model.entity.Entity;

/**
 * An event which is fired when an entity is modified in some way (name changed, etc)
 * 
 * @author Ryan Cheatham
 */
public class EntityModifiedEvent extends GenericEntityEvent
{
  private final Entity oldData;
  private final Entity newData;

  /**
   * Constructs a new EntityModifiedEvent with the given data.
   * 
   * @param oldData
   *          The entity before it was modified.
   * @param newData
   *          The entity after it was modified.
   */
  public EntityModifiedEvent(Entity oldData, Entity newData)
  {
    this.oldData = oldData;
    this.newData = newData;
  }

  /**
   * Returns the entity before it was modified.
   */
  public Entity getOldData()
  {
    return oldData;
  }

  /**
   * Returns the entity after it was modified.
   */
  public Entity getNewData()
  {
    return newData;
  }
}
